
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_ThongKeMonHocByMaSV]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
	drop procedure [dbo].[sp_ThongKeMonHocByMaSV]
GO
create procedure sp_ThongKeMonHocByMaSV
	@MaSV varchar(10)
as
begin			
	SELECT	sum(MH.Chung_Chi) as TongChungChi,
			sum(MH.Le_phi) as TongLePhi
	FROM MonHoc as MH 
	inner join DangKy as DK on DK.MaMH=MH.MaMH 
	WHERE  DK.MaSV = @MaSV
	--Group By MH.MaMH
end

